{% extends "base.html" %}
{% load sorter %}
{% block content %}
<table>
  <tr>
    <td>{% sorter "choice" "Choice" %}</td> 
    <td>{% sorter "poll" "Poll" %}</td> 
    <td>{% sorter "user" "User" %}</td> 
    <td>{% sorter "pub_date" "Date Published" %}</td>
  </tr>
  {% for object in objects.object_list %}
  <tr>
    <td>{{ object.choice }}</td> 
    <td><a href="{{ object.poll.get_absolute_url }}">{{ object.poll }}</a></td> 
    <td>
      <a href="{{ object.user.get_absolute_url }}">{{ object.user }}</a>
      {% load iptocountry_flag %}{% get_flag object.ip_address as flag %}
      <img src="{{ flag.flag_url }}" alt="{{ flag.COUNTRY_NAME|lower }}" />
    </td> 
    <td>{{ object.pub_date }}</td>
  </tr>
{% endfor %}
</table>
<div class="pagination">
    <span class="step-links">
        {% if objects.has_previous %}
            <a href="?page={{ objects.previous_page_number }}">previous</a>
        {% endif %}
        <span class="current">
            Page {{ objects.number }} of {{ objects.paginator.num_pages }}.
        </span>
        {% if objects.has_next %}
            <a href="?page={{ objects.next_page_number }}">next</a>
        {% endif %}
    </span>
</div>
{% endblock %}
